package com.origin.onlinesys.service.modules.app;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.origin.onlinesys.domain.modules.app.AppInfoBean;
import com.origin.onlinesys.common.services.BaseService;
import com.origin.onlinesys.persistence.modules.app.AppInfoMapper;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2015/6/25.
 */
@Service
public class AppInfoService extends BaseService<AppInfoBean> {
    public String getCount(){
        return ((AppInfoMapper)mapper).getCount();
    }
    public Map selectPage(int pageNum, int pageSize,String startDate, String endDate){
        Map search = new HashMap();
        search.put("startDate",startDate);
        search.put("endDate",endDate);
        PageHelper.startPage(pageNum, pageSize, true);
        Page<AppInfoBean> page = (Page)((AppInfoMapper)mapper).selectPage(search);
        Map result = new HashMap();
        result.put("list", page);
        result.put("pageSize", page.getPages());
        result.put("total", page.getTotal());
        return result;
    }
}
